package ml;

import java.io.File;

public class ArffPathUtil {

	public static enum Part {
		training("training_data"), testing("test_data"), contest("contest_data");

		private final String file;

		private Part(final String filename) {
			this.file = filename;
		}

		public String getFile() {
			return file;
		}
	}

	public static enum Type {
		music("music"), speech("speech");

		private final String file;

		private Type(final String filename) {
			this.file = filename;
		}

		public String getFile() {
			return file;
		}
	}

	public static enum Preprocessed {
		original("original"), originalmerged("original.merged"), originalmergednew(
				"original.merged.new"), all("all.subsample"), merged(
				"all.merged"), cfs("all.subsample.cfs"), top5(
				"all.subsample.top5attr"), top10("all.subsample.top10attr"), top10merged(
				"all.subsample.top10merged"), mergednew("all.merged.new");

		private final String file;

		private Preprocessed(final String filename) {
			this.file = filename;
		}

		public String getFile() {
			return file;
		}
	}

	public static enum Sampling {
		all("all", 100), p20("subsample-20.0pct", 20), p10("subsample-10.0pct",
				10), p5("subsample-5.0pct", 5), p2_5("subsample-2.5pct", 2.5), p1(
				"subsample-1.0pct", 1);

		private final String filename;
		public final double value;

		private Sampling(final String filename, final double value) {
			this.filename = filename;
			this.value = value;
		}

		public String getFile(final Part part, final Type type) {
			return part.name() + "." + type.name() + "." + filename + ".arff";
		}
	}

	private static final String PS = File.separator;

	public static String getPath(final Part part, final Type type,
			final Preprocessed preprocessed, final Sampling sampling) {
		return Main.DATA_DIRECTORY + PS + part.getFile() + PS + type.getFile()
				+ PS + preprocessed.getFile() + PS
				+ sampling.getFile(part, type);
	}

	public static String getPath(final Part part, final Type type,
			final Preprocessed preprocessed) {
		return Main.DATA_DIRECTORY + PS + part.getFile() + PS + type.getFile()
				+ PS + preprocessed.getFile() + PS;
	}

}
